package cn.yunhe.services;

import cn.yunhe.dao.ITypeDaoMapper;
import cn.yunhe.entity.merchantsentity.Type;
import cn.yunhe.util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.ArrayList;
import java.util.List;
/**
 * 周依博
 */
public class ShowTypeService {
    SqlSession session=null;
    ITypeDaoMapper typeDaoMapper=null;
    public List<Type> getAllType(){
        List<Type> typeList = new ArrayList<>();
        try{
            session = SqlSessionFactoryUtil.getSqlSession();
            typeDaoMapper = session.getMapper(ITypeDaoMapper.class);
            typeList= typeDaoMapper.getAllType();
        }finally {
            session.close();
        }
        return typeList;
    }
}
